const { pathToRegexp } = require("path-to-regexp");
let params = [];
let regexp = pathToRegexp("/home", params, { end: false }); // ===> ^\/home(?:[\/#\?](?=[]|$))?(?=[\/#\?]|[]|$
console.log(regexp);

console.log(regexp.test("/home"));
console.log(regexp.test("/home/"));
console.log(regexp.test("/home#"));
console.log(regexp.test("/home?"));
console.log(regexp.test("/home/user"));
